<template>
  <router-view/>
</template>

<style>
html, body, #app {
  height: 100%;
}

.app-container {
  padding: 20px;
}
</style>
<script setup>
import {useRoute} from "vue-router";
import {watch} from "vue";
import store from "@/store";
// import Cookies from "js-cookie";

const route = useRoute()


watch(route, (to,) => {
  if (to.path === '/userCenter') {
    let obj = {
      name: to.name,
      path: to.path,
    }
    store.commit('ADD_TABS', obj)
  }
}, {
  deep: true,
  immediate: true
})

// // 监听 sessionStorage 的变化
// window.addEventListener('storage', (event) => {
//   if (event.key === 'token') {
//     token.value = event.newValue;
//   }
// });

document.title = process.env.VUE_APP_TITLE
</script>